home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / HFSHalfGateway / HFSHalfGateway.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  2.2 KB  |  89 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        HFSHalfGateway.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14.  
  15. #ifndef __HFSHALFGATEWAY__
  16. #define __HFSHALFGATEWAY__
  17.  
  18. #ifndef __BLJSTANDARDINCLUDES__
  19. #include "BLJStandardIncludes.h"
  20. #endif
  21.  
  22. #ifndef __HALFGATEWAY__
  23. #include "HalfGateway.h"
  24. #endif
  25.  
  26. #ifndef    THREAD_H
  27. // #include "Thread.h"
  28. #endif
  29.  
  30. #ifndef    __OCE__
  31. #include "OCE.h"
  32. #endif
  33.  
  34. class TMailGateway;
  35. class TLetter;
  36. class TRecipient;
  37.  
  38. /***********************************|****************************************/
  39.  
  40. class THFSHalfGateway : public THalfGateway
  41. {
  42. public:
  43.             THFSHalfGateway();
  44.     virtual ~THFSHalfGateway ();
  45.     
  46.     virtual Boolean Setup (TMailGateway& gateway, short vRefNum, long dirID, const char* gatewayName);
  47.  
  48.     virtual Boolean BeginRecoveryPhase();
  49.     virtual Boolean IsRecoveryDone();
  50.     virtual Boolean FinishRecoveryPhase();
  51.  
  52.     virtual Boolean ResendLetter (TLetter*);
  53.     virtual Boolean RereceiveLetter (TLetter*);
  54.  
  55.     virtual Boolean Run ();
  56.     virtual Boolean    SendLetter (TLetter*);
  57.     virtual Boolean    ReceiveLetter (TLetter*);
  58.  
  59.     virtual Boolean    PrepareToShutDown(long inHowManySeconds);
  60.     virtual Boolean    IsHalfGatewayShuttingDown();
  61.     virtual Boolean    IsHalfGatewayReadyToShutDown();
  62.     virtual Boolean    CancelHalfGatewayShutdown ();
  63.     virtual Boolean    ShutDown();
  64.  
  65.     void ScanHFSForOutgoingLetters();
  66.  
  67. protected:
  68.  
  69.     Boolean ReceiveIncomingLetterForRecipient (TLetter *, TRecipient *);
  70.     
  71.     //    This reads the 'startup' configuration from the disk, placing it into our
  72.     //    fields serverIdentity, and serverIdentityKey.
  73.  
  74.     OSErr CreateLetterFromFSSpec(FSSpec& fileSpec, RString& address,short isFile);
  75.     
  76.     Boolean                            fShuttingDown;            // this is set to true when the gateway is trying
  77.     RString                            fServerName;
  78.     thread*                            fRunThreadH;
  79.     thread*                            fScanHFSThreadH;        // this thread periodically checks if mail is
  80.     short                            fWorkingVRefNum;        //    the vRefNum of this half gateway.
  81.     long                            fWorkingDirID;
  82.     long                            fHFSMailFolderDirID;    
  83.     long                            fSentMailDir;
  84. };
  85.  
  86. /***********************************|****************************************/
  87.  
  88. #endif    // __HFSHALFGATEWAY__
  89.